package com.sleepcamel.resteasyConfigurator.components.tree.strategies;

import com.sleepcamel.rest.domain.TreeNode;
import com.sleepcamel.resteasyConfigurator.components.tree.ITreeContentStrategy;

public class PackageTreeContentStrategy implements ITreeContentStrategy {

	@Override
	public Object[] getChildren(Object arg0) {
		if (arg0 instanceof TreeNode) {
			return ((TreeNode) arg0).getChilds().toArray();
		}
		return null;
	}

	@Override
	public Object getParent(Object arg0) {
		if (arg0 instanceof TreeNode) {
			return ((TreeNode) arg0).getParent();
		}
		return null;
	}

}
